startSync
function from the top-most scope of your app, peers with the same app ID immediately form a mesh network using a mixture of communication transports, each with advantages and disadvantages. For example, Ditto prioritizes Wi-Fi for its high bandwidth and only falls back to Bluetooth LE when needed to take advantage of its longer-range capabilities.
Unlike typical home networks — which represent a star topology where all devices connect directly to a central router, switch, or access point — a peer-to-peer mesh network offers multiple pathways for communication.
Here’s a quick video overview by Ditto’s Network Transports Team Lead, Tom Karpiniec:
Platform | Ditto-Supported Technology |
---|---|
Apple | Apple Wireless Direct Link (AWDL) |
Android | Wi-Fi Aware |
string
of alphanumeric characters uniquely identifies your app across the Ditto platform and other integrated systems and environments, including:
onlinePlayground
identity, you can sync with other peers who share the same app ID and read and write to collections without the hassle of setting up your own authentication.
registers
to a predefined value, the resulting merge accurately represents the original input and some rational interpretation of that input.
TransportConfig
, which is stored within the main Ditto
object. By default, if you don’t make any changes to this configuration, Ditto will automatically enable all available peer-to-peer transports.
If you create a new TransportConfig,
it has three main sections:
peerToPeer
connect
listen
peerToPeer
and WebSocket settings. For instructions, see Customizing Transports Configurations.
listen
parameters designated for scenarios, like web browser clients operating on fully offline networks, only when explicitly instructed by Ditto support.Misconfiguring these listener features may bypass Ditto’s standard encryption and access control mechanisms, leading to potential security vulnerabilities.